package com.decent.ejfadmin.order.dao.provider;

import java.util.HashMap;
import java.util.Objects;

/**
 * @author Hejl on 2017/12/23.
 */
public class TrySellBatchDaoProvider {

    public String queryBatch(HashMap<String, Integer> map) {

        StringBuffer sql = new StringBuffer(100);

        sql.append(" select count(1) from yuhuang_try_sell_batch where batchId = #{batchId} ");

        if (Objects.nonNull(map.get("productType"))) {
            sql.append("  and productType = #{productType} ");
        }
        return sql.toString();
    }

    public String remove(HashMap<String, Integer> map) {
        StringBuffer sql = new StringBuffer(100);
        sql.append(" delete from yuhuang_try_sell_batch where batchId = #{batchId}  ");

        if (Objects.nonNull(map.get("productType"))) {
            sql.append(" and productType = #{productType} ");
        }
        return sql.toString();
    }
}
